﻿@model ConsumablesModel

@Html.ValidationSummary(false)
@Html.HiddenFor(model => model.Id)

<script>
    $(document).ready(function () {
        bindBootstrapTabSelectEvent('equipment-edit');
    });
</script>

<style type="text/css">
    .col-content {
        display: flex;
        align-items: center;
        justify-content: normal;
        height: 34px;
    }
</style>

<div class="content">
    <div class="form-horizontal">
        <div class="row">
            <div class="col-md-12 clearfix">
                <div class="pull-left">
                    @Html.Action("Mode", "Setting", new { modeName = "equipment-advanced-mode" })
                </div>
            </div>
        </div>
        <div id="equipment-edit" class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                @Html.RenderBootstrapTabHeader("tab-info", @T("Admin.Catalog.Categories.Info"), true)
            </ul>
            <div class="tab-content">
                @Html.RenderBootstrapTabContent("tab-info", @TabInfo(), true)
            </div>
        </div>
    </div>
</div>

@{
    //custom tabs
    var eventMessage = new AdminTabStripCreated(this.Html, "equipment-edit");
    EngineContext.Current.Resolve<IEventPublisher>().Publish(eventMessage);
    foreach (var eventBlock in eventMessage.BlocksToRender)
    {
        @eventBlock
    }
}

@*save selected tab name*@
<input type="hidden" id="selected-tab-name" name="selected-tab-name" value="@(Html.GetSelectedTabName())">

@helper TabInfo()
{
    <div class="content" style="padding-bottom:0;">
        <div class="form-horizontal">
            <div class="panel-group">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                分类
                            </div>
                            <div class="col-md-9">
                                <div class="input-group input-group-required">
                                    @Html.EditorFor(model => model.CategoryId, new { SelectList = Model.AvailableCategories })
                                    @Html.ValidationMessageFor(model => model.CategoryId)
                                    <div class="input-group-btn">
                                        @Html.RequiredHint()
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-3">
                                名称
                            </div>
                            <div class="col-md-9">
                                @Html.NopEditorFor(model => model.Name, required: true)
                                @Html.ValidationMessageFor(model => model.Name)
                            </div>
                        </div>

                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                品牌
                            </div>
                            <div class="col-md-9">
                                @Html.NopEditorFor(model => model.Manufacturer)
                                @Html.ValidationMessageFor(model => model.Manufacturer)
                            </div>
                        </div>

                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                规格型号
                            </div>
                            <div class="col-md-9">
                                @Html.NopEditorFor(model => model.Specification)
                                @Html.ValidationMessageFor(model => model.Specification)
                            </div>
                        </div>

                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                单位
                            </div>
                            <div class="col-md-9">
                                @Html.NopEditorFor(model => model.Unit)
                                @Html.ValidationMessageFor(model => model.Unit)
                            </div>
                        </div>

                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                最低库存
                            </div>
                            <div class="col-md-9">
                                @Html.NopEditorFor(model => model.StockMin)
                                @Html.ValidationMessageFor(model => model.StockMin)
                            </div>
                        </div>

                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                排序
                            </div>
                            <div class="col-md-9">
                                @Html.NopEditorFor(model => model.DisplayOrder)
                                @Html.ValidationMessageFor(model => model.DisplayOrder)
                            </div>
                        </div>

                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                发布
                            </div>
                            <div class="col-md-9">
                                @Html.NopEditorFor(x => x.Published)
                                @Html.ValidationMessageFor(model => model.Published)
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
}
